public class Solution
{
    public static void main(String[] args) {
        int max = Integer.parseInt(args[0]);
        int min = Integer.parseInt(args[1]);
        System.out.print(maxnum(min, max)+" "+minnum(min, max));
    }
    public static int maxnum(int min, int max) {
        while(max%min!=0){
            int temp=max%min;
            max=min;
            min=temp;
        }
        return min;
    }
    public static int minnum(int min, int max) {
        return min* max / maxnum(min, max);
    }
}